import { Tools } from 'weaver-mobile';
import DocConstant from '../util/index';
const catchApiError = DocConstant.catchApiError;
//调用附件转换
export const convertFile = params => Tools.callApi({url: '/api/doc/acc/convertFileForMobile', method: 'GET', params}).then();
//通过附件id获取当前附件所在文档的信息
export const fileToDocDetail = params => {
    let locationParams = DocConstant.getLocationParams();
    return Tools.callApi({url: '/api/doc/mobile/systemDoc/filetodocdetail', method: 'GET', params: {...locationParams, ...params}}).then(catchApiError);
}
//根据附件id来判断当前附件是不是图片
export const isPicture = params => Tools.callApi({url: '/api/doc/mobile/systemDoc/ispicture', method: 'GET', params}).then();

//获取下载链接后边跟的参数（处理ios下载问题）
export const getDownloadParams = params => Tools.callApi({url: '/api/doc/mobile/imagefile/getMobileDownloadParams', method: 'GET', params}).then();

